package cassys.dataaccess;

/**
 * 
 * 
 * @author Priyanka
 */

public abstract class DAOFactory {
    
    public abstract LectureDAO getLecturerDAO();
    
    public abstract EvaluationDAO getEvaluationDAO();
    
    public abstract ModuleDAO getModuleDAO();
    
    public abstract PeerAssessmentDAO getPeerAssessmentDAO();
    
    public abstract StudentDAO getStudentDAO();
    
    public abstract StudentModuleTeamDAO getStudentModuleTeamDAO();
    
    public abstract TeamDAO getTeamDAO();
    
    public abstract UserDAO getUserDAO();
    
    public abstract AssessmentDAO getAssessmentDAO();
    
    private static DAOFactory instance;
    
//    public static int USERACCESS = 2;
//    public static int PRODUCTACCESS = 1;
//    public static int VENDORACCESS = 1;
    private static int accessConfig = 1; // by default access DB
    
    
    public static DAOFactory getInstance() {
        
        instance = loadInstance(accessConfig);
        
        return instance;
    }
    public static DAOFactory getInstance(int i) {
        
        instance = loadInstance(i);
        
        return instance;
    }
    
    private static DAOFactory loadInstance(int acc){
        
        System.out.println("*****DAOFactory : LOADING *****" + acc);
        
        
        switch (acc) {
            
            case (1):
                return new cassys.dataaccess.hibernate.DAOFactoryImpl();
               
            default:
                return new cassys.dataaccess.hibernate.DAOFactoryImpl();
                
        }
    }
    
}